# -*- coding: utf-8 -*-
# @Time    : 2024/8/30 下午2:27
# @Author  : wb
# @Email   : wb@163.com
# @File    : client_page
# @Software: PyCharm

from time import sleep
from pages.wb_base_page import BasePage
from selenium.webdriver.common.by import By


class ClientModifyCarePage(BasePage):
    url = '/crm'
    # 定位器
    '''获取关怀主题输入框元素'''
    care_subject_locator = (By.CSS_SELECTOR, '#name')
    '''获取保存按钮元素'''
    save_locator = (By.CSS_SELECTOR,'body > div.container > div.row > div > form > table > tfoot > tr > td:nth-child(2) > input.btn.btn-primary')

    # 浏览器操作
    def clear_care_subject(self):
        # 清空关怀主题
        self.driver.find_element(*self.care_subject_locator).clear()
    def modify_input_subject(self,care_subject):
        # 编辑关怀主题为特殊字符
        self.driver.find_element(*self.care_subject_locator).send_keys(care_subject)
    def modify_save(self):
        # 点击保存
        self.driver.find_element(*self.save_locator).click()
    sleep(3)
